package com.fieldchain.ex.fa100.utils.screen;

import android.graphics.Rect;
import android.view.View;

public class LocationUtils {
    public static Rect getLocation(View view){
        Rect rect = new Rect();
        int location[] = new int[2];
        view.getLocationOnScreen(location);  //获取屏幕中位置
        rect.left = location[0];
        rect.top = location[1];
        rect.right = rect.left + view.getWidth();
        rect.bottom = rect.top + view.getHeight();

        return rect;
    }
}
